from django.urls import path
from rest_framework.routers import DefaultRouter
from studentweb.views import FacultyViewSet, MajorViewSet, StudentViewSet

# 实例化一个DefaultRouter
router = DefaultRouter()
# 注册faculty对象
router.register('facultys', FacultyViewSet, basename='facultys')
# 注册Major对象
router.register('majors', MajorViewSet, basename='majors')
# 注册student对象
router.register('students', StudentViewSet, basename='students')

urlpatterns = []
urlpatterns += router.urls
